<!DOCTYPE html>
<html lang="en-US" dir="ltr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Runtime API Examples | zijid-ui</title>
    <meta name="description" content="一个ui库">
    <meta name="generator" content="VitePress v1.3.4">
    <link rel="preload stylesheet" href="/zijid-ui-dome/assets/style.DOtj9TfK.css" as="style">
    
    <script type="module" src="/zijid-ui-dome/assets/app.C86koO5X.js"></script>
    <link rel="preload" href="/zijid-ui-dome/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
    <link rel="modulepreload" href="/zijid-ui-dome/assets/chunks/theme.JeDqD2vs.js">
    <link rel="modulepreload" href="/zijid-ui-dome/assets/chunks/framework.CxxP_cWD.js">
    <link rel="modulepreload" href="/zijid-ui-dome/assets/api-examples.md.pGmBhD3U.lean.js">
    <script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
    <script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
  </head>
  <body>
    <div id="app"><div class="Layout" data-v-48d697d2><!--[--><!--]--><!--[--><span tabindex="-1" data-v-f3b4a1fb></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-f3b4a1fb> Skip to content </a><!--]--><!----><header class="VPNav" data-v-48d697d2 data-v-03d91078><div class="VPNavBar top" data-v-03d91078 data-v-e6287f11><div class="wrapper" data-v-e6287f11><div class="container" data-v-e6287f11><div class="title" data-v-e6287f11><div class="VPNavBarTitle" data-v-e6287f11 data-v-6884be3c><a class="title" href="/zijid-ui-dome/" data-v-6884be3c><!--[--><!--]--><!----><span data-v-6884be3c>zijid-ui</span><!--[--><!--]--></a></div></div><div class="content" data-v-e6287f11><div class="content-body" data-v-e6287f11><!--[--><!--]--><div class="VPNavBarSearch search" data-v-e6287f11><!----></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-e6287f11 data-v-38307ea2><span id="main-nav-aria-label" class="visually-hidden" data-v-38307ea2> Main Navigation </span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/zijid-ui-dome/" tabindex="0" data-v-38307ea2 data-v-fcd34053><!--[--><span data-v-fcd34053>首页</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/zijid-ui-dome/api.html" tabindex="0" data-v-38307ea2 data-v-fcd34053><!--[--><span data-v-fcd34053>例子</span><!--]--></a><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-e6287f11 data-v-2b315d88><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to dark theme" aria-checked="false" data-v-2b315d88 data-v-59308932 data-v-b3f01bc2><span class="check" data-v-b3f01bc2><span class="icon" data-v-b3f01bc2><!--[--><span class="vpi-sun sun" data-v-59308932></span><span class="vpi-moon moon" data-v-59308932></span><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-e6287f11 data-v-5f8a1221 data-v-8d618a9b><!--[--><a class="VPSocialLink no-icon" href="https://github.com/zijid/zijid-ui-dome" aria-label="github" target="_blank" rel="noopener" data-v-8d618a9b data-v-ef2fbf59><span class="vpi-social-github" /></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-e6287f11 data-v-07cc11ae data-v-1c0c0e0d><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-1c0c0e0d><span class="vpi-more-horizontal icon" data-v-1c0c0e0d></span></button><div class="menu" data-v-1c0c0e0d><div class="VPMenu" data-v-1c0c0e0d data-v-928c94c4><!----><!--[--><!--[--><!----><div class="group" data-v-07cc11ae><div class="item appearance" data-v-07cc11ae><p class="label" data-v-07cc11ae>Appearance</p><div class="appearance-action" data-v-07cc11ae><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to dark theme" aria-checked="false" data-v-07cc11ae data-v-59308932 data-v-b3f01bc2><span class="check" data-v-b3f01bc2><span class="icon" data-v-b3f01bc2><!--[--><span class="vpi-sun sun" data-v-59308932></span><span class="vpi-moon moon" data-v-59308932></span><!--]--></span></span></button></div></div></div><div class="group" data-v-07cc11ae><div class="item social-links" data-v-07cc11ae><div class="VPSocialLinks social-links-list" data-v-07cc11ae data-v-8d618a9b><!--[--><a class="VPSocialLink no-icon" href="https://github.com/zijid/zijid-ui-dome" aria-label="github" target="_blank" rel="noopener" data-v-8d618a9b data-v-ef2fbf59><span class="vpi-social-github" /></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-e6287f11 data-v-d19adcad><span class="container" data-v-d19adcad><span class="top" data-v-d19adcad></span><span class="middle" data-v-d19adcad></span><span class="bottom" data-v-d19adcad></span></span></button></div></div></div></div><div class="divider" data-v-e6287f11><div class="divider-line" data-v-e6287f11></div></div></div><!----></header><div class="VPLocalNav empty fixed" data-v-48d697d2 data-v-999ff4fa><div class="container" data-v-999ff4fa><!----><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-999ff4fa data-v-a6375011><button data-v-a6375011>Return to top</button><!----></div></div></div><!----><div class="VPContent" id="VPContent" data-v-48d697d2 data-v-6c0a65ee><div class="VPDoc has-aside" data-v-6c0a65ee data-v-ac6aa90b><!--[--><!--]--><div class="container" data-v-ac6aa90b><div class="aside" data-v-ac6aa90b><div class="aside-curtain" data-v-ac6aa90b></div><div class="aside-container" data-v-ac6aa90b><div class="aside-content" data-v-ac6aa90b><div class="VPDocAside" data-v-ac6aa90b data-v-6274331c><!--[--><!--]--><!--[--><!--]--><nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline" data-v-6274331c data-v-7d4b08bf><div class="content" data-v-7d4b08bf><div class="outline-marker" data-v-7d4b08bf></div><div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading" data-v-7d4b08bf>On this page</div><ul class="VPDocOutlineItem root" data-v-7d4b08bf data-v-67145188><!--[--><!--]--></ul></div></nav><!--[--><!--]--><div class="spacer" data-v-6274331c></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-ac6aa90b><div class="content-container" data-v-ac6aa90b><!--[--><!--]--><main class="main" data-v-ac6aa90b><div style="position:relative;" class="vp-doc _zijid-ui-dome_api-examples" data-v-ac6aa90b><div><h1 id="runtime-api-examples" tabindex="-1">Runtime API Examples <a class="header-anchor" href="#runtime-api-examples" aria-label="Permalink to &quot;Runtime API Examples&quot;">​</a></h1><p>This page demonstrates usage of some of the runtime APIs provided by VitePress.</p><p>The main <code>useData()</code> API can be used to access site, theme, and page data for the current page. It works in both <code>.md</code> and <code>.vue</code> files:</p><div class="language-md vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">md</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">script</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> setup</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { useData } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;vitepress&#39;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">theme</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">page</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">frontmatter</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> useData</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">script</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;--shiki-light-font-weight:bold;--shiki-dark-font-weight:bold;">## Results</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;--shiki-light-font-weight:bold;--shiki-dark-font-weight:bold;">### Theme Data</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">pre</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;{{ theme }}&lt;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">pre</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">### Page Data</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">pre</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;{{ page }}&lt;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">pre</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">### Page Frontmatter</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">pre</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;{{ frontmatter }}&lt;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">pre</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;</span></span></code></pre></div><h2 id="results" tabindex="-1">Results <a class="header-anchor" href="#results" aria-label="Permalink to &quot;Results&quot;">​</a></h2><h3 id="theme-data" tabindex="-1">Theme Data <a class="header-anchor" href="#theme-data" aria-label="Permalink to &quot;Theme Data&quot;">​</a></h3><pre>{
  &quot;nav&quot;: [
    {
      &quot;text&quot;: &quot;首页&quot;,
      &quot;link&quot;: &quot;/&quot;
    },
    {
      &quot;text&quot;: &quot;例子&quot;,
      &quot;link&quot;: &quot;/api&quot;
    }
  ],
  &quot;sidebar&quot;: [],
  &quot;socialLinks&quot;: [
    {
      &quot;icon&quot;: &quot;github&quot;,
      &quot;link&quot;: &quot;https://github.com/zijid/zijid-ui-dome&quot;
    }
  ]
}</pre><h3 id="page-data" tabindex="-1">Page Data <a class="header-anchor" href="#page-data" aria-label="Permalink to &quot;Page Data&quot;">​</a></h3><pre>{
  &quot;title&quot;: &quot;Runtime API Examples&quot;,
  &quot;description&quot;: &quot;&quot;,
  &quot;frontmatter&quot;: {
    &quot;outline&quot;: &quot;deep&quot;
  },
  &quot;headers&quot;: [],
  &quot;relativePath&quot;: &quot;api-examples.md&quot;,
  &quot;filePath&quot;: &quot;api-examples.md&quot;
}</pre><h3 id="page-frontmatter" tabindex="-1">Page Frontmatter <a class="header-anchor" href="#page-frontmatter" aria-label="Permalink to &quot;Page Frontmatter&quot;">​</a></h3><pre>{
  &quot;outline&quot;: &quot;deep&quot;
}</pre><h2 id="more" tabindex="-1">More <a class="header-anchor" href="#more" aria-label="Permalink to &quot;More&quot;">​</a></h2><p>Check out the documentation for the <a href="https://vitepress.dev/reference/runtime-api#usedata" target="_blank" rel="noreferrer">full list of runtime APIs</a>.</p></div></div></main><footer class="VPDocFooter" data-v-ac6aa90b data-v-893cefb4><!--[--><!--]--><!----><!----></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>
    <script>window.__VP_HASH_MAP__=JSON.parse("{\"api-examples.md\":\"pGmBhD3U\",\"api.md\":\"BDPD28x_\",\"index.md\":\"0qXMMRfU\",\"readme.md\":\"Bty953XS\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"zijid-ui\",\"description\":\"一个ui库\",\"base\":\"/zijid-ui-dome/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"nav\":[{\"text\":\"首页\",\"link\":\"/\"},{\"text\":\"例子\",\"link\":\"/api\"}],\"sidebar\":[],\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/zijid/zijid-ui-dome\"}]},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
    
  </body>
</html>